package ooday1.home.Addition;

import java.util.Random;
import java.util.Scanner;

public class Addition {
    public static void main(String[] args) {
        System.out.println("开始计算游戏答题");
        Random ran=new Random();
        Scanner scn=new Scanner(System.in);
        int f=0;
        int c=10;
        for (int i=1;i<=c;i++){
           int a=ran.nextInt(100);
           int b=(int)(Math.random()*100);
            System.out.println(a+"+"+b+"=?");
            System.out.println(a+b);
            System.out.println("请输入答案");
            int d= scn.nextInt();
            if (d==a+b) {
                f += 10;
                System.out.println("答对了加10分");
            }
        }
        System.out.println("共答对"+(f/10)+"题目共"+f+"分");

    }
}
